*****Here is code for Appendix OD where tie strength is used as a moderator variable for disagreement

****Attitude Importance
	*Partisan Disagreement
		drop _est_*
		eststo clear
		eststo: regress samesex10imp c.pdiff_avg##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store SS
		eststo: regress richtaxes10imp c.pdiff_avg##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store RT
		eststo: regress medic10imp c.pdiff_avg##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store ME
		eststo: regress drugs10imp c.pdiff_avg##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store DR
		eststo: regress path10imp c.pdiff_avg##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store PA
		eststo: regress illeg10imp c.pdiff_avg##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store ILL
		eststo: regress habeas10imp c.pdiff_avg##c.network_close c.age c.age#c.age  c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store HAB
		eststo: regress phone10imp c.pdiff_avg##c.network_close c.age c.age#c.age  c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store PHONE
		esttab using partydiff_imp_netclose.rtf, addnotes(Results are from OLS models. Cell entries are unstandardized coefficients. Analyses are weighted (wgtL10).) onecell star(+ 0.10 * 0.05 ** 0.01) label se ar2
	
	*General Disagreement
		eststo clear
		eststo: regress samesex10imp c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store SS1
		eststo: regress richtaxes10imp c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store RT1
		eststo: regress medic10imp c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store ME1
		eststo: regress drugs10imp c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store DR1
		eststo: regress path10imp c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store PA1
		eststo: regress illeg10imp c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store ILL1
		eststo: regress habeas10imp c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store HAB1
		eststo: regress phone10imp c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store PHONE1
		esttab using gendiff_imp_netclose.rtf, addnotes(Results are from OLS models. Cell entries are unstandardized coefficients. Analyses are weighted (wgtL10).) onecell star(+ 0.10 * 0.05 ** 0.01) label se ar2

		*Graph of moderation effects
		coefplot (SS, label(Partisan Disagreement)) (SS1, label(General Disagreement)), bylabel(Same Sex Marriage) || ///
		RT RT1, bylabel(Taxes on the Rich) || DR DR1, bylabel(Drugs for Seniors)|| ME ME1, bylabel(Gov't Medical Care) || ///
		HAB HAB1, bylabel(Habeas Corpus) || PHONE PHONE1, bylabel(Wiretaps) || ILL ILL1, bylabel(Immigrant Work Stay) || ///
		PA PA1, bylabel(Path to Citizenship) ||, noci at recast(line) yline(0, lpattern(dash)) ylabel(-.4(0.20)0.4) byopts(title(Marginal Effect of Disagreement on Importance by Avg. Tie Strength))

***Attitude Extremity

		drop _est_*
	*Partisan disagreement
		drop _est_*
		eststo clear
		eststo: regress samesex10ext c.pdiff_avg##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store SS
		eststo: regress richtaxes10ext c.pdiff_avg##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store RT
		eststo: regress medic10ext c.pdiff_avg##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store ME
		eststo: regress drugs10ext c.pdiff_avg##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store DR
		eststo: regress path10ext c.pdiff_avg##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store PA
		eststo: regress illeg10ext c.pdiff_avg##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store ILL
		eststo: regress habeas10ext c.pdiff_avg##c.network_close c.age c.age#c.age  c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store HAB
		eststo: regress phone10ext c.pdiff_avg##c.network_close c.age c.age#c.age  c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(pdiff_avg) at(network_close=(1(1)5)) post
		estimates store PHONE
		esttab using partydiff_ext_netclose.rtf, addnotes(Results are from OLS models. Cell entries are unstandardized coefficients. Analyses are weighted (wgtL10).) onecell star(+ 0.10 * 0.05 ** 0.01) label se ar2
	
	*General Disagreement
		eststo clear
		eststo: regress samesex10ext c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store SS1
		eststo: regress richtaxes10ext c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store RT1
		eststo: regress medic10ext c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store ME1
		eststo: regress drugs10ext c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store DR1
		eststo: regress path10ext c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store PA1
		eststo: regress illeg10ext c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store ILL1
		eststo: regress habeas10ext c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store HAB1
		eststo: regress phone10ext c.gendiff##c.network_close c.age c.age#c.age   c.interest10 c.pid10 c.ideology10 i.gender  c.educ c.income i.race c.network_genderh c.network_denom c.race_network c.network_size c.network_close c.network_interest c.network_educ [pweight = WGTL10]
		margins, dydx(gendiff) at(network_close=(1(1)5)) post
		estimates store PHONE1
		esttab using gendiff_ext_netclose.rtf, addnotes(Results are from OLS models. Cell entries are unstandardized coefficients. Analyses are weighted (wgtL10).) onecell star(+ 0.10 * 0.05 ** 0.01) label se ar2

	*Graphing the Effects*
		coefplot (SS, label(Partisan Disagreement)) (SS1, label(General Disagreement)), bylabel(Same Sex Marriage) || ///
		RT RT1, bylabel(Taxes on the Rich) || DR DR1, bylabel(Drugs for Seniors)|| ME ME1, bylabel(Gov't Medical Care) || ///
		HAB HAB1, bylabel(Habeas Corpus) || PHONE PHONE1, bylabel(Wiretaps) || ILL ILL1, bylabel(Immigrant Work Stay) || ///
		PA PA1, bylabel(Path to Citizenship) ||, noci at recast(line) yline(0, lpattern(dash)) ylabel(-.4(0.20)0.4) byopts(title(Marginal Effect of Disagreement on Extremity\ by Avg. Tie Strength))
